package cn.com.cifi.mars.web.action.sys;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.alibaba.fastjson.JSONArray;

import cn.com.cifi.mars.bean.vo.sys.req.EnableSysPermissionReqParam;
import cn.com.cifi.mars.bean.vo.sys.req.SaveDictionaryTypeReqParam;
import cn.com.cifi.mars.bean.vo.sys.req.SaveSysPermissionReqParam;
import cn.com.cifi.mars.bean.vo.sys.req.UpdateSysPermissionReqParam;
import cn.com.cifi.mars.bean.vo.sys.rsp.UserFunctionalPermissionVo;
import cn.com.cifi.mars.common.bean.R;
import cn.com.cifi.mars.common.constants.VersionConstant;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;

@Api(tags = {"系统管理"})
@RequestMapping("/${spring.data.rest.base-path}/{apiVersion}/sys/sysPermission")
public interface ISysPermissionController {

	 @ApiOperation(value = "添加菜单(权限)", notes = "添加菜单(权限)")
	 @PostMapping(value = "")
	 public R<String> createSysPermission(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            @RequestBody SaveSysPermissionReqParam param);
	 
	 @ApiOperation(value = "编辑菜单(权限)", notes = "编辑菜单(权限)")
	 @PutMapping(value = "")
	 public R<String> updateSysPermission(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            @RequestBody UpdateSysPermissionReqParam param);
	 
	 @ApiOperation(value = "禁用启用菜单(权限)", notes = "禁用启用菜单(权限)")
	 @PutMapping(value = "enable")
	 public R<String> updateEnableSysPermission(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion,
	            @RequestBody EnableSysPermissionReqParam param);
	 
	 @ApiOperation(value = "菜单管理-菜单(权限)树", notes = "菜单管理-菜单(权限)树")
	 @GetMapping(value = "tree")
	 public R<JSONArray> getSysPermissionTree(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);
	 
	 
	 @ApiOperation(value = "获取当前用户的功能权限", notes = "获取当前用户的功能权限")
	 @GetMapping(value = "currentUser")
	 public R<UserFunctionalPermissionVo> getCurrentUserPermissions(
	            @ApiParam(value = "接口版本", required = true, defaultValue = VersionConstant.V1) @PathVariable(value = "apiVersion") String apiVersion);
	 
	 
}
